<template>
  <div class="user">
    <tree-com
      :title="treeObj.name"
      :list="treeObj.children"
      :depth="0"
    ></tree-com>
  </div>
</template>

<script>
import TreeCom from "./tree";
/**
 * 模拟一个树形结构图
 */
const treeObj = {
  name: "电子文档目录",
  children: [
    {
      name: "专业书籍",
      children: [
        {
          name: "philips",
          children: [
            { name: "philips-A" },
            { name: "philips-B" },
            { name: "philips-C" }
          ]
        },
        {
          name: "Tcl",
          children: [
            { name: "Mac Air" },
            { name: "Mac Pro" },
            {
              name: "ThinlPad",
              children: [
                {
                  name: "ThinlPad-A",
                  children: [
                    { name: "ThinlPad-A-a" },
                    { name: "ThinlPad-A-b" },
                    { name: "ThinlPad-A-c" }
                  ]
                },
                { name: "ThinlPad-B" },
                { name: "ThinlPad-C" },
                { name: "ThinlPad-D" }
              ]
            }
          ]
        },
        { name: "海兴" }
      ]
    },
    {
      name: "专利库",
      children: [{ name: "acer" }, { name: "联想" }, { name: "惠普" }]
    },
    {
      name: "博客文章",
      children: [
        {
          name: "手环",
          children: [
            { name: "华为B5手环" },
            { name: "小米手环" },
            { name: "iphone手环" }
          ]
        }
      ]
    }
  ]
};
export default {
  name: "User",
  components: { TreeCom },
  data() {
    return { treeObj };
  }
};
</script>
